package com.winit.schedule.core.conf;

public class JobConfiguration extends Configuration {

    // configuration

    public static final String  USCHEDULE_PREFIX              = "uschedule.";

    public static final String  HEARTBEAT_PREFIX              = USCHEDULE_PREFIX + "heartbeat.";

    /**
     * 心跳间隔
     */
    public static final String  HEARTBEAT_INTERVAL_MS         = HEARTBEAT_PREFIX + "interval.ms";

    public static final long    DEFAULT_HEARTBEAT_INTERVAL_MS = 1000 * 3;

    /**
     * job tracker 与 task tarcker 通讯超时时间，必须大于等于5个心跳周期
     */
    public static final String  HEARTBEAT_TIMEOUT_MS          = HEARTBEAT_PREFIX + "timeout.ms";

    public static final int     DEFAULT_HEARTBEAT_TIMEOUT_MS  = 1000 * 6 * 5;

    /**
     * 远程调用超时时间
     */
    public static final String  CONNECT_TIMEOUT               = "rpc.connect.timeout.ms";

    public static final int     DEFAULT_CONNECT_TIMEOUT       = 3000;

    private static final String ZK_PREFIZ                     = USCHEDULE_PREFIX + "zk.";

    public static final String  ZK_COONNECT_ADDR              = ZK_PREFIZ + "connect.address";

    public static final String  ZK_USERNAME                   = ZK_PREFIZ + "username";
    public static final String  DEFAULT_ZK_USERNAME           = "uschedule";

    public static final String  ZK_PASSWORD                   = ZK_PREFIZ + "password";
    public static final String  DEFAULT_ZK_PASSWORD           = "uschedule";

    public static final String  ZK_SESSION_TIMEOUT            = ZK_PREFIZ + "session.timeout";

    public static final int     DEFAULT_ZK_SESSION_TIMEOUT    = 6000;

    public static final String  ZK_USCHEDULE_ROOTPATH         = ZK_PREFIZ + "rootPath";

    public static final String  DEFAULT_ZK_USCHEDULE_ROOTPATH = "/uschedule";

    public static final String  ZK_SASL_CLIENT                = ZK_PREFIZ + "sasl.client";

    public static final boolean DEFAULT_ZK_SASL_CLIENT        = false;

    public JobConfiguration(){
        super();
        Configuration.addDefaultResource("uschedule-core.properties");
    }

    public JobConfiguration(Configuration other){
        super(other);
    }

}
